﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="JquerynoConfict方法.aspx.cs" Inherits="_jquery_JquerynoConfictFunction" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<script src="jquery-latest-pack.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">

   var Tong ={
             jquery:jQuery,
             $:$
   };
   



</script>
    <title>Untitled Page</title>
    <style type="text/css">

p
	{margin-right:0cm;
	margin-left:0cm;
	font-size:12.0pt;
	font-family:宋体;
	}
span.code1
	{font-family:Verdana;
	color:black;
	border:solid #0099CC 1.0pt;
	padding:4.0pt;
	background:#DDEDFB;
        }
 </style>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <p style="text-align:justify;text-justify:inter-ideograph;line-height:140%">
            <span style="font-size:11.0pt;line-height:140%;color:black">使用<span 
                lang="EN-US" style="background: aqua">jquery</span>中的<span lang="EN-US" 
                style="background: aqua">jQuery</span><span lang="EN-US">.noConflict();</span>方法即可把变量<span 
                lang="EN-US">$</span>的控制权让渡给第一个实现它的那个库或之前自定义的<span lang="EN-US">$</span>方法。之后应用<span 
                lang="EN-US" style="background: aqua">Jquery</span>的时候只要将所有的<span 
                lang="EN-US">$</span>换成<span lang="EN-US" style="background: aqua">jQuery</span>即可，如原来引用对象方法<span 
                lang="EN-US">$(&quot;#msg&quot;)</span>改为<span lang="EN-US" style="background: aqua">jQuery</span><span 
                lang="EN-US">(&quot;#msg&quot;)</span>。<span lang="EN-US"><br />
            </span>如：<span lang="EN-US"><o:p></o:p></span></span></p>
        <p style="text-align:justify;text-justify:inter-ideograph;line-height:140%">
            <span class="code1"><span lang="EN-US" 
                style="font-size: 9.0pt; line-height: 140%; background: aqua">jQuery</span><span 
                lang="EN-US" style="font-size:9.0pt;line-height:140%">.noConflict(); </span>
            </span><span lang="EN-US" 
                style="font-size: 9.0pt; line-height: 140%; font-family: Verdana; color: black; border: solid #0099CC 1.0pt; mso-border-alt: solid #0099CC .75pt; padding: 4.0pt; background: #DDEDFB">
            <br />
            <span class="code1">// </span></span><span class="code1">
            <span style="font-size:
9.0pt;line-height:140%;font-family:宋体;mso-ascii-font-family:Verdana;mso-hansi-font-family:
Verdana">开始使用</span><span lang="EN-US" 
                style="font-size: 9.0pt; line-height: 140%; background: aqua">jQuery</span></span><span 
                lang="EN-US" 
                style="font-size: 9.0pt; line-height: 140%; font-family: Verdana; color: black; border: solid #0099CC 1.0pt; mso-border-alt: solid #0099CC .75pt; padding: 4.0pt; background: #DDEDFB"><br />
            </span><span class="code1"><span lang="EN-US" 
                style="font-size: 9.0pt; line-height: 140%; background: aqua">jQuery</span><span 
                lang="EN-US" style="font-size:9.0pt;line-height:140%">(&quot;div&nbsp;&nbsp; 
            p&quot;).hide();</span></span><span lang="EN-US" 
                style="font-size: 9.0pt; line-height: 140%; font-family: Verdana; color: black; border: solid #0099CC 1.0pt; mso-border-alt: solid #0099CC .75pt; padding: 4.0pt; background: #DDEDFB"><br />
            <span class="code1">// </span></span><span class="code1">
            <span style="font-size:
9.0pt;line-height:140%;font-family:宋体;mso-ascii-font-family:Verdana;mso-hansi-font-family:
Verdana">使用其他库的</span><span lang="EN-US" style="font-size:9.0pt;line-height:140%"> $()
            </span></span><span lang="EN-US" 
                style="font-size: 9.0pt; line-height: 140%; font-family: Verdana; color: black; border: solid #0099CC 1.0pt; mso-border-alt: solid #0099CC .75pt; padding: 4.0pt; background: #DDEDFB">
            <br />
            <span class="code1">$(&quot;content&quot;).style.display = &#39;none&#39;;</span></span><span 
                lang="EN-US" style="font-size:11.0pt;line-height:140%;color:black"><o:p></o:p></span></p>
    </div>
    
    <script type ="text/javascript">
     
    </script>
    <span 
                lang="EN-US" 
                style="font-size: 9.0pt; line-height: 140%; font-family: Verdana; color: black; border: solid #0099CC 1.0pt; mso-border-alt: solid #0099CC .75pt; padding: 4.0pt; background: #DDEDFB">
    <asp:ListBox ID="ListBox1" runat="server" DataSourceID="LinqDataSource1" 
        DataTextField="Title" DataValueField="Id" Height="236px" Width="272px">
    </asp:ListBox>
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
        ContextTypeName="Linq_SQLServeDataContext" Select="new (Id, Title)" 
        TableName="M_News">
    </asp:LinqDataSource>
            </span>
    
    </form>
    
    
    </body>

    <script language="javascript" type="text/javascript">
/*
    document.getElementById("<%=ListBox1.ClientID %>").onchange=function()
    {
     alert(_jquery_JquerynoConfictFunction.pubTab(this.value).value);
    };*/
    Tong.jquery("#<%=ListBox1.ClientID %>").change(
        function()
        {
         alert(_jquery_JquerynoConfictFunction.pubTab(this.value).value);
        }
    );
    
    alert(Tong.$("div").size());

</script>
    
</html>

